window.AJAX = {
    callBack : {},index : 1,
    get : function(url,succCall,errCall,timeout){
        var id = this.index++;
        this.callBack[id] = [succCall,errCall];
        uexXmlHttpMgr.open(id,'get',url,(timeout||0));
        this._send(id);
    },
    post : function(url,data,succCall,errCall,timeout){
        var id = this.index++;
        this.callBack[id] = [succCall,errCall];
        uexXmlHttpMgr.open(id,'post',url,(timeout||0));
        if(data){
            for(var k in data){
                uexXmlHttpMgr.setPostData(id,0,k,data[k]);
            }
        }
        this._send(id);
    },
    _send : function(id){
        uexXmlHttpMgr.onData = this.onData;
        uexXmlHttpMgr.send(id);
    },
    onData : function(inOpCode,inStatus,inResult){
        var that=AJAX,callBack = that.callBack[inOpCode]||[];
        if(inStatus==-1){
            callBack[1] && callBack[1]();
            delete that.callBack[inOpCode];
        }else if(inStatus==1){
            callBack[0] && callBack[0](inResult);
            delete that.callBack[inOpCode];   
        }
         
    }
};